<?php

class Debug
{
    static protected $_output;
    static protected $_on = true;

    static public function touch($tag, $file, $line)
    {
        self::$_output[$tag] = self::$_output[$tag] .  "$file @ $line<br />\n";
    }

    static public function dump($tag, $name, $value)
    {
        self::$_output[$tag] = self::$_output[$tag] . '$name:' . "<br />\n";
        self::$_output[$tag] = self::$_output[$tag] . print_r($value, true);
        self::$_output[$tag] = self::$_output[$tag] . "<br />\n";
    }

    static public function _display($tag)
    {
        if (self::$_on)
            echo self::$_output[$tag];
    }

    static public function off()
    {
        self::$_on = false;
    }
    static public function on()
    {
        self::$_on = true;
    }

    static public function isOn()
    {
        return self::$_on;
    }
}

?>